<?php

use console\db\channels\TransferTableMigration;

/**
 * 圈子动态点赞信息转移
 * 
 * @author emhome <emhome@163.com>
 * @since 1.0
 */
class m300020_000008_t_sns_dynamic_like extends TransferTableMigration {

    /**
     * @inheritdoc
     */
    public $sourceDb = 'olddb';

    /**
     * @inheritdoc
     */
    public function validateTransfer(&$data) {
        if (parent::validateTransfer($data)) {
            if ($data['tid'] && $data['uid']) {
                return true;
            }
        }
        return false;
    }

    /**
     * @inheritdoc
     */
    public function getTransferOptions() {
        return [
            'table' => [
                'sns_dynamic_like' => 'sns_group_thread_priase',
            ],
            'columns' => [
                'user_id' => 'uid',
                'dynamic_id' => 'tid',
                'comment_id' => 'pid',
                'created_at' => 'inputtime',
                'updated_at' => 'inputtime',
            ]
        ];
    }

}
